package cn.ly.core.inclass;

public class StaticOuterClass {
	private static String outName;
	private int age;
	
	public StaticOuterClass(String name,int age){
		this.outName = name;
		this.age = age;
	}
	
	private static void callName(){
		System.out.println(outName);
	}
	
	private void getAge(){
		System.out.println(this.age);
	}
	
	static public class InnerClass{//可以把静态内部类想象成一个类的静态成员，尊序静态成员的规则
		public InnerClass(){
		}
		
		public String getOutName(){
			return StaticOuterClass.outName;
		}
		
		public void callOutName(){
			StaticOuterClass.callName();
		}
		
		/*public String getOutAge(){     //不能访问非静态成员变量和方法，编译报错
			return StaticOuterClass.this.age;
		}*/
		
		/*public void callOutAge(){
			StaticOuterClass.this.getAge();
		}*/
	}
	

}
